import scrapy
from crawler.items import*


class TestSpider(scrapy.Spider):
    custom_settings = {
        'ITEM_PIPELINES': {'crawler.pipelines.TestPipeline': 300}
    }
    name = 'test'
    allowed_domains = ['TTTTT.com']
    start_urls = ['http://www.TTTTT.com/hypernym/?q=']

    def parse(self, response):
        if response.url == '': #接收到url==''时
            print('Exception')
        item = TestItem()
        item['a'] = 2
        yield item
